<?php

use yii\widgets\DetailView;
use backend\assets\LayuiAsset;
use common\models\UserRank;

LayuiAsset::register($this);
?>
<div class="article-category-view">
    <?= DetailView::widget([
        'model' => $model,
        'options' => ['class' => 'layui-table'],
        'template' => '<tr><th width="100px">{label}</th><td>{value}</td></tr>',
        'attributes' => [
            'id',
            'name',
            [
                'attribute' => 'notice',

            ],
            [
                "attribute" => "created_at",
                "value" => function ($data) {
                    return date("Y-m-d H:i:s", $data->created_at);
                }
            ],
            [
                "attribute" => "updated_at",
                "value" => function ($data) {
                    return isset($data->updated_at) ? date("Y-m-d H:i:s", $data->updated_at) : "";
                }
            ],
        ],
        'template' => '<tr><th width="90px;">{label}</th><td>{value}</td></tr>',
    ]) ?>

</div>
